package com.example.aiquestions.model.dto;

import com.example.aiquestions.entity.User;
import lombok.Data;

@Data
public class LoginResponseDTO {
    private boolean success;
    private String message;
    private User user;

    public static LoginResponseDTO success(User user) {
        LoginResponseDTO response = new LoginResponseDTO();
        response.setSuccess(true);
        response.setMessage("登录成功");
        response.setUser(user);
        return response;
    }

    public static LoginResponseDTO fail(String message) {
        LoginResponseDTO response = new LoginResponseDTO();
        response.setSuccess(false);
        response.setMessage(message);
        return response;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}